<?php
namespace app\api\model;

use think\Model;

require_once APP_VENDOR.'Aliyunsms/api/Sms.php';


class User extends Model
{   
    public function getVerifity($mobile){
        $verify   = rand(1000,9999);
        $Sms = new \vendor\Aliyunsms\api\Sms("LTAIjwKoxUrL1xoS","y38qYYEKrClr0P8gTrpwAyUV55XtNR");
        $response = $Sms->sendSms(
            "力杆", // 短信签名
            "SMS_78900467", // 短信模板编号
            $mobile, // 短信接收者
            Array(  // 短信模板中字段的值
                "code"=>$verify,
                "product"=>"dsd"
            ),
            "123"
        );

        return $response->Code == 'OK' ? $verify : false; 
        
    }


}